<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    #avatar img{width: 100px;height: 100px}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">借阅状态</td><td id="state_name" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">图书编号</td><td id="number" class="tv"></td><td class="tt">图书分类</td><td id="booktype_name" class="tv"></td></tr>
                <tr><td class="tt">图书名称</td><td id="name" class="tv"></td><td class="tt">作者</td><td id="author" class="tv"></td></tr>
                <tr><td class="tt">出版社</td><td id="chushe" class="tv"></td><td class="tt">图书说明</td><td id="isbn" class="tv"></td></tr>
                <tr><td class="tt">图书封面</td><td id="avatar" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">入库日期</td><td id="rudt" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">存放位置</td><td id="cunaddr" class="tv"></td><td class="tt">入库人</td><td id="ruer_name" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td id="explain" colspan="3" class="tv"></td></tr>

                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">借阅记录</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_book_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;


                $("#state_name").text(data.state_name);
                $("#number").text(data.number);
                $("#name").text(data.name);
                $("#booktype_name").text(data.booktype_name);
                $("#author").text(data.author);
                $("#chushe").text(data.chushe);
                $("#isbn").text(data.isbn);
                $("#rudt").text(data.rudt);
                $("#cunaddr").text(data.cunaddr);
                $("#ruer_name").text(data.ruer_name);
                $("#explain").text(data.explain);

                if(data.avatar){
                    $("#avatar").html('<img onclick="show_avatar(\''+get_file_complete(data.avatar)+'\')" src="'+get_file_complete(data.avatar)+'">');
                }else{
                    // $("#avatar").html('<img onclick="show_avatar(\'/static/admin/images/avatar.png\')" src="/static/admin/images/avatar.png">');
                }
                // $(".pageshowtitle").text('图书库');


                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号'}
                        ,{field: 'jieer_name', title: '借阅人'}
                        ,{field: 'jieer_dept', title: '部门'}
                        ,{field: 'created_at', title: '借阅日期'}
                        ,{field: 'guidt', title: '归还日期'}
                        ,{field: 'state_name', title: '状态'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });




                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('book', param_id);
        showpage_dropopt();
    });



</script>
</body>
</html>




